		<div class="breadcrumb clearfix">
			<div class="title k1">Thêm bài viết</div>
		</div>
		<ul id="warning-box" class="error-box" style="display: none;">
			<li class="first">Bạn vui lòng kiểm tra lại thông tin bên dưới</li>
		</ul>
		<form enctype="multipart/form-data" action="<?php echo $this->baseUrl().'/admin/topic/create/'; ?>" method="post" id="form_create">
			<div class="clearfix">
				<table width="100%" cellpadding="0" cellspacing="0" border="0" class="table_input_wapper">
					<tr>
						<td colspan="2">
							<h2><span>1</span>Thông tin cơ bản</h2>
						</td>
					</tr>
					<tr class="table_input_tr">
						<td width="50%" class="table_input_td">
							<div class="table_input_title">
								<label>Tên bài viết:</label>
							</div>
							<input name="topic_name" id="topic_name" value="<?php echo (isset($this->params['topic_name'])?$this->escape($this->params['topic_name']):'');?>" class="table_input_text"/>
						</td>
						<td width="50%" class="table_row table_input_td_last">
							<div class="table_input_title">
								<label>Danh mục:</label>
							</div>
							<!--<input name="topic_name" id="topic_name" class="table_input_text"/>-->
							<?php echo $this->dropList($this->categories, array('category_id', 'category_name'), 'category_id', 'category_id', 'table_input_text', ((isset($this->params['category_id']))?$this->params['category_id']:0));?>
						</td>
					</tr>
					<tr>
						<td width="50%" class="table_input_td table_input_td_end">
							<div class="table_input_title">
								<label>Ảnh đại diện:</label>
							</div>
							<input type="file" name="topic_image" id="topic_image" class="table_input_text"/>
						</td>
						<td width="50%" class="table_row table_input_td_last table_input_td_end">
							<!--<div class="table_input_title">
								<label>Ngày tạo:</label>
							</div>
							<strong><?php echo date("d/m/Y", time());?></strong>-->
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<h2><span>2</span>Nội dung chính</h2>
						</td>
					</tr>
					<tr class="table_input_tr">
						<td width="100%" colspan="2" class="table_input_td">
							<div class="table_input_title">
								<label>Trích dẫn:</label>
							</div>
							<textarea name="topic_intro" id="topic_intro"><?php echo (isset($this->params['topic_intro']))?$this->escape($this->params['topic_intro']):'';?></textarea>
						</td>
					</tr>
					<tr>
						<td width="100%" colspan="2" class="table_input_td table_input_td_end">
							<div class="table_input_title">
								<label>Toàn bài:</label>
							</div>
							<textarea name="topic_details" id="topic_details"><?php echo (isset($this->params['topic_details']))?$this->escape($this->params['topic_details']):'';?></textarea>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<h2><span>3</span>SEO</h2>
						</td>
					</tr>
					<tr class="table_input_tr">
						<td width="50%" class="table_input_td">
							<div class="table_input_title">
								<label>Tiêu đề:</label>
							</div>
							<input name="topic_title" id="topic_title" class="table_input_text" value="<?php echo isset($this->params['topic_title'])?$this->escape($this->params['topic_title']):'';?>"/>
						</td>
						<td width="50%" class="table_row table_input_td_last">
							<div class="table_input_title">
								<label>Từ khóa:</label>
							</div>
							<input name="meta_keywords" id="meta_keywords" class="table_input_text" value="<?php echo (isset($this->params['meta_keywords']))?$this->escape($this->params['meta_keywords']):'';?>" />
						</td>
					</tr>
					<tr>
						<td width="50%" class="table_input_td">
							<div class="table_input_title">
								<label>Mô tả:</label>
							</div>
							<textarea name="meta_description" id="meta_description" rows="3" class="table_input_text"><?php echo (isset($this->params['meta_description']))?$this->params['meta_description']:'';?></textarea>
						</td>
						<td width="50%" class="table_row table_input_td_last">
						</td>
					</tr>
				</table>
				<div class="table_input_end button_listing_input clear">
					<input type="button" name="Cập nhật" value="" class="button_update" id="buttom_submit">
					<input type="button" name="Cập nhật" value="" class="button_cancel">
				</div>
			</div>
		</form>
<script type="text/javascript">
	$(document).ready(function() {
		var tinymce_path = '<?php echo $this->baseUrl()?>/admin/js/tiny_mce/tiny_mce.js'; 
		$('#topic_intro').tinymce({
			// Location of TinyMCE script
			script_url : tinymce_path,
	
			// General options
			theme : "simple",
			language 	: "vi",
            theme 		: "advanced",
            plugins 	: "paste",
            width		: "805",
            height		: "100",
			plugins 	: "paste",
	
			// Theme options
			theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,|,table,removeformat,code",
			theme_advanced_buttons2 : "",
	        theme_advanced_buttons3 : "",
	        theme_advanced_buttons4 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : true,
	
			// Example content CSS (should be your site CSS)
			content_css : "css/content.css",
	
			// Drop lists for link/image/media/template dialogs
			//template_external_list_url : "lists/template_list.js",
			//external_link_list_url : "lists/link_list.js",
			//external_image_list_url : "lists/image_list.js",
			//media_external_list_url : "lists/media_list.js"
		});
		$('#topic_details').tinymce({
			// Location of TinyMCE script
			script_url : tinymce_path,
	
			// General options
			theme : "advanced",
			language 	: "vi",
            theme 		: "advanced",
            plugins 	: "paste",
            width		: "805",
            height		: "300",
			plugins 	: "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",
	
			// Theme options
			theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
			theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : true,
	
			// Example content CSS (should be your site CSS)
			content_css : "css/content.css",
	
			// Drop lists for link/image/media/template dialogs
			template_external_list_url : "lists/template_list.js",
			external_link_list_url : "lists/link_list.js",
			external_image_list_url : "lists/image_list.js",
			media_external_list_url : "lists/media_list.js"
		});
		
		$("#buttom_submit").click(function(){
            $("#form_create").submit();
        });

		$("#form_edit").validate({
            rules: {
				topic_name: {
                    required: true,
                    maxlength: 50
                },
                category_id: "required",                
                topic_intro: "required",
                topic_details: "required"
            },
	        messages: {
    	        topic_name: "",
            	category_id: "",
                topic_intro: "",
                topic_details: ""
	        },
		    errorLabelContainer: "#warning-box",
		    wrapper: "li",
		    submitHandler: function(form) {
		        form.submit();
		    }
		});
	});
</script>